home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48hor1 / macf.doc < prev    next >
Text File  |  1995-03-31  |  3KB  |  76 lines

  1. Author: [Rick Grevelle] 
  2.   Subj: CMACF Fix 
  3.   Date: Wed Sep 12 1990 07:57  
  4.  
  5. Thanks to J"urgen Koslowski for pointing out an error in the create MACF 
  6. routine.  However, the fix offered isn't quite right.  The one below is. 
  7.  
  8. CMACF [4152] 
  9.  
  10. %%HP: T(3)A(D)F(.);  
  11. \<< 
  12.        # 3174197160731741h 
  13.        # 181314E331741607h 
  14.        # 4173170EC6A830F8h 
  15.        # C808461241731705h 
  16.                    ^^^          digits transposed, ought to read 731! 
  17.    1  3  START 
  18.           # 5193h   SYSEVAL 
  19.          NEXT  #2DCCh 
  20.           # 5A03h   SYSEVAL 
  21.           # 5ACCh   SYSEVAL 
  22. \>> 
  23.   
  24.  
  25. In regards to your question concerning the instruction DA; it is a MOVE, 
  26. register to register, and is explained in the Processor Notes as follows: 
  27.   
  28. ------------------------------------------------------------------------- 
  29.  
  30. MOVE Register to Register 
  31.  
  32.                ppz      MOVE.f s,d 
  33.  
  34.                                            pp | f     z | s d 
  35.                                           --------   --------- 
  36.                                            A8 | P     4 | B A 
  37.                                            A9 | WP    5 | C B 
  38.                                            AA | XS    6 | A C 
  39.                                            AB | X     7 | C D 
  40.                                            AC | S     8 | A B 
  41.                                            AD | M     9 | B C 
  42.                                            AE | B     A | C A 
  43.                                            AF | W     B | D C 
  44.                                            D  | A      
  45.  
  46. Examples: 
  47.  
  48. D9     MOVE.A  B,C       ; C gets B   (20 bits) 
  49. AE4    MOVE.B  B,A       ; A gets B    (8 bits) 
  50. AFB    MOVE.W  D,C       ; C gets D   (64 bits) 
  51. DA     MOVE.A  C,A       ; A gets C   (20 bits) 
  52.  
  53.  
  54. >Another suggestion concerning this program: It seems to me that the 
  55. >new HP48 instruction NEWOB can be used to replace "" +, saving 2.5 bytes. 
  56.  
  57. In an effort to keep routines such as these short, it becomes necessary to 
  58. use a bit of trickery.  STRING->CODE uses a combination of two tricks; one  
  59. used by Alonzo in his PEEK scheme, and another one that I discovered.  The 
  60. point here is that NEWOB will indeed work and save 2.5 bytes in doing so. 
  61.  
  62. However, neither of the two are particularly efficient.  They are merely a 
  63. convenient manner in which to compensate for the forementioned lazy trickery. 
  64.  
  65. It should be mentioned that HP does not use trickery of this sorts.  Thanks 
  66. to a variable length PEEK routine written for the 28, I was able to isolate  
  67. and disassemble the routines responsible for updating low RAM when new objects 
  68. are created.   
  69.  
  70. A more recent example of how this is done in the 48 can be found in the ->ASC  
  71. and ASC-> routines recently posted by Dr. Wickes.  The details involved here 
  72. are numerous, and time required to understand them would be great.  Now that 
  73. school is back in full swing, I have no such luxury! 
  74.  
  75. Rick Grevelle 
  76.